package yx1;


import java.util.Hashtable;

public class PrototypeManager<Prototype> {
    private Hashtable<String,Prototype> ht = new Hashtable();  //使用Hashtable存储原型对象

    public PrototypeManager() {


        ht.put("WeeklyLog", (Prototype) new WeeklyLog());
    }

    public void Set(String key, Prototype prototype) {
        ht.put(key, prototype);
    }

    public Prototype Get(String key) {
//        System.out.println(ht.get(key));
        return ht.get(key);
    }

}
//class cs {
//    public static void main(String[] args) {
//        PrototypeManager<WeeklyLog> ob = new PrototypeManager<>();
//        WeeklyLog a =(WeeklyLog) ob.Get("WeeklyLog");
//        System.out.println(ob.Get("WeeklyLog").Clone()+"rd  555");
//        System.out.println(a);
//
//        ob.Set("1",new WeeklyLog());
//        WeeklyLog a1 = ob.Get("1");
//        System.out.println(a1.Clone());
//        if (a==a1){
//            System.out.println("是同一个对象");
//        }else {
//            System.out.println("不是同一个对象");
//        }
//    }
//}


